package com.gt.admin.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.gt.common.core.controller.BaseController;
import com.gt.common.core.domain.AjaxResult;
import com.gt.admin.domain.Operation;
import com.gt.admin.service.IOperationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "sc-手术")
@RestController
@RequestMapping("/flow-scheme/operation")
public class OperationController extends BaseController {
    @Autowired
    private IOperationService operationService;

    /**
     * 查询手术列表
     */
    @ApiOperation(value = "查询手术列表")
    @GetMapping("/{sickId}")
    public AjaxResult listBySickId(@PathVariable("sickId")Long sickId){
        LambdaQueryWrapper<Operation> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(Operation::getSickId, sickId);
        return AjaxResult.success(operationService.list(queryWrapper));
    }
}
